/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author LYS
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../../../model/baseModel';

const { adminPath } = useGlobSetting();

export interface BasWorkShop extends BasicModel<BasWorkShop> {
  code?: string; // 车间编码
  name?: string; // 车间名称
  officeId?: string; // 归属部门
  leader?: string; // 负责人
}

export const basWorkShopList = (params?: BasWorkShop | any) =>
  defHttp.get<BasWorkShop>({ url: adminPath + '/bas/mes/workshop/basWorkShop/list', params });

export const basWorkShopListData = (params?: BasWorkShop | any) =>
  defHttp.post<Page<BasWorkShop>>({
    url: adminPath + '/bas/mes/workshop/basWorkShop/listData',
    params,
  });

export const basWorkShopForm = (params?: BasWorkShop | any) =>
  defHttp.get<BasWorkShop>({ url: adminPath + '/bas/mes/workshop/basWorkShop/form', params });

export const basWorkShopSave = (params?: any, data?: BasWorkShop | any) =>
  defHttp.postJson<BasWorkShop>({
    url: adminPath + '/bas/mes/workshop/basWorkShop/save',
    params,
    data,
  });

export const basWorkShopDisable = (params?: BasWorkShop | any) =>
  defHttp.get<BasWorkShop>({
    url: adminPath + '/bas/mes/workshop/basWorkShop/disable',
    params,
  });

export const basWorkShopEnable = (params?: BasWorkShop | any) =>
  defHttp.get<BasWorkShop>({
    url: adminPath + '/bas/mes/workshop/basWorkShop/enable',
    params,
  });

export const basWorkShopDelete = (params?: BasWorkShop | any) =>
  defHttp.get<BasWorkShop>({
    url: adminPath + '/bas/mes/workshop/basWorkShop/delete',
    params,
  });

export const basWorkShopTreeData = (params?: BasWorkShop | any) =>
  defHttp.post<Recordable>({ url: adminPath + '/bas/mes/workshop/basWorkShop/treeData', params });
